package cn.getech.data.development.entity;

import cn.getech.data.intelligence.common.validator.group.AddGroup;
import cn.getech.data.intelligence.common.validator.group.UpdateGroup;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * 项目用户关系表
 * </p>
 *
 * @author wcj
 * @since 2019-10-29
 */
@Data
@Accessors(chain = true)
@TableName("bdp_proc_user")
public class ProcUser implements Serializable {

    private static final long serialVersionUID = 1L;
    /**
     * 编号
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     *项目编号
     */
    @NotNull(message = "项目编号不可为空",groups = {AddGroup.class, UpdateGroup.class})
    private Integer procId;

    /*
    用户编号
     */
    @NotNull(message = "项目编号不可为空",groups = {UpdateGroup.class})
    private Integer userId;

    /*
    用户名
     */
    @NotBlank(message = "用户名不可为空",groups = {AddGroup.class})
    @TableField(exist = false)
    private String userName;

    /**
     * 是否是创建者，是为1，否为0，默认为0
     */
    private Integer isOwner;
}
